package com.xinhe.web.session;

import org.apache.commons.lang3.ObjectUtils;

import java.util.Random;
import java.util.UUID;

public class UserSessionManagerVirtual extends UserSessionManager{
    public boolean validToken() {
        return true;
    }

    public Long getUserId() {
        return Long.valueOf((new Random()).nextLong());
    }

    public boolean validRole(Long roleId) {
        return true;
    }

    public String getExtendValue(String key, String defaultValue) {
        return (String) ObjectUtils.defaultIfNull(defaultValue, UUID.randomUUID().toString());
    }
}
